import { getCurrentInstance } from "vue";
import { useI18n } from "vue-i18n";
import { useAppStore } from "@/store";
export function useTranslate() {
  const { t } = useI18n();
  return t;
}

export function useChangeLnag() {
  const app = getCurrentInstance();
  const { changeLang } = useAppStore();
  return (lang: string) => {
    app!.proxy!.$i18n.locale = lang;
    changeLang(lang);
  };
}
